window.onload = function () {
    //动态设置导航栏中按钮距离
    var nav = document.getElementsByTagName("nav")[0];
    //console.log(nav);
    var nav_width = getComputedStyle(nav, null).width;
    //console.log(nav_width);
    var li = document.getElementsByTagName("li");
    var li_width = getComputedStyle(li[0], null).width;
    //console.log(li_width);
    for (i = 0; i < li.length; i++) {
        li[i].style.marginLeft = (parseInt(nav_width) - 4 * parseInt(li_width)) / 5 + "px";
    }
    var li_num;
    //写tab切换效果
    for (i = 0; i < li.length; i++) {
        li[i].onclick = function () {
            li[i].className = "on";
        };
    }
};